package com.wsoft.bpm.node;

import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.lang.reflect.Field;

/**
 * 字段域
 *
 * @Author zhonglj
 * @Date 2024-09-11 9:44
 */
@Setter
@Getter
@Accessors(chain = true)
public class ListenerField extends ActivityXml {
    private static final String EXPRESS = "express";
    private String name;
    private ListenerFieldString string;
    private ListenerFieldExpression expression;

    public ListenerField() {
        setTagName("activiti:field");
    }

    @Override
    public Boolean skip(Field field) {
        //string的优先级大于express
        if (EXPRESS.equals(field.getName()) && string != null) {
            return true;
        }

        return false;
    }
}
